/**
 * 
 */
package com.cdhospital.adminservice;

import com.cdhospital.Model.User;

/**
 * @author 17994
 *
 */
public class LoginService {
	private static final User dao=new User().dao();
	
	public User getUserByNamePasswd(String name, String password) {
		String sql="select * from user where username=? and password=? ";
		
		return dao.findFirst(sql, name,password);
	}
	public User getUserByNamePasswds(String name, String password) {
		String sql="select * from user where username=? and password=? ";
		
		return dao.findFirst(sql, name,password);
	}

	public User changemm(String oldpassword) {
		String sql="select * from user where password=?";
		return dao.findFirst(sql,oldpassword);
	}
	public User getUserByName(String name) {
		String sql="select * from user where username= ?";
		
		return dao.findFirst(sql, name);
	}
	public User getUserByWeixin(int name) {
		String sql="select * from user where weixinid= ?";
		
		return dao.findFirst(sql, name);
	}
}
